 <?php 
      global $db;
      $id = $_GET['id'];
      if($id != ''){
              $sql ="select id,content,time from nettteach_note where id=".$id;
              $result =$db->query($sql);
              $re =$db->fetch_array($result);
      ?>
<form action="?do=note&id=<?php echo $re['id']?>" method="post">
      <div class="indexcates" style="float:left; border:2px ; width:75%;">
              <div style="border:1px solid #CCC;margin:0 auto;width:50%;padding:10px;"><a  href="javascript:history.go(-1)" > 返回上一页 </a>
<!--                      <div style="width:100%;text-align: center"><h3 style="color: #003D79;font-size:15px;font-weight: 800"><?php echo substr($re['content'],0,30);?></h3></div>-->
                      <div style="width:100%;text-align: center"><span>创建于:<?php echo date('Y-m-d H:i:s',$re['time'])?></span></div><br>  
                      <b>内容:</b><textarea style="width:300px;overflow-y:visible;"  rows="8" name="content"><?php echo $re['content']?></textarea>
              </div>
      <div style="margin-top: 3px;text-align:right;margin:0 auto;width:50%;padding:3px 5px;">
              <input type="submit" name="updatenote" value="修改"  style="padding:5px;" />
              <input name="deletenote" type="submit" value="删除"  style="padding:5px;"/>
      </div>            
     </div>   </form>
     <?php
      }
      if(isset($_POST['updatenote'])){
              $content = $_POST['content'];
              if($content !='')
              {
                      $sql ="update  nettteach_note set content = '".$content."' where id=".$id;
                      $result =$db->query($sql);
                      if($result){
                              fs_showmsg("修改成功");
                      }
              }else{
                      fs_showmsg("不能为空");
              }
      }
      if(isset($_POST['deletenote'])){
                      $sql ="delete from  nettteach_note where id=".$id; 
                      $result =$db->query($sql);
                      if($result){
                              fs_showmsg("删除成功","?do=notelist");
                      }
      }
      ?>

  
  